package sim.ring.gui.treedata;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import sim.ring.gui.RingingSimManager;

public class MethodTreeLabelProvider extends LabelProvider {
	
	@Override
	public String getText(Object element) {
		if (element instanceof DataModel) {
			return ((DataModel)element).getName();
		} else return "X";
	}
	
	@Override
	public Image getImage(Object element) {
		if (element instanceof Folder) {
			return RingingSimManager.getIMGReg().get("folderIcon");
		} else if (element instanceof Category) {
			return RingingSimManager.getIMGReg().get("categoryIcon");
		} else if (element instanceof TMethod) {
			return RingingSimManager.getIMGReg().get("methodIcon");
		} else return null;
	}
}
